cmake_minimum_required(VERSION 2.6)
project(facader)

# Include rapidjson
include_directories(${PROJECT_SOURCE_DIR}/3rd/rapidjson/include)

# Include CNC Sparse matrix
include_directories(${PROJECT_SOURCE_DIR}/3rd)


# Find rapidjson
include_directories(${PROJECT_SOURCE_DIR}/3rd/rapidjson/include)
message(STATUS "rapidjson path " ${PROJECT_SOURCE_DIR}/rapidjson/include)

# Find CNC Sparse matrix
include_directories(${PROJECT_SOURCE_DIR}/3rd)

# Find PCL 
find_package(PCL 1.3 REQUIRED)

# Find OpenCV
find_package(OpenCV REQUIRED)

# FInd Boost
set(Boost_USE_STATIC_LIBS OFF) 
set(Boost_USE_MULTITHREADED ON)  
set(Boost_USE_STATIC_RUNTIME OFF) 
find_package(Boost COMPONENTS program_options system unit_test_framework REQUIRED) 

if (PCL_FOUND)
    include_directories(${PCL_INCLUDE_DIRS})
    link_directories(${PCL_LIBRARY_DIRS})
    add_definitions(${PCL_DEFINITIONS})   
else (PCL_FOUND)
    message(FATAL_ERROR "Could not find pcl library")
endif (PCL_FOUND)

if (OpenCV_FOUND)
    include_directories(${OpenCV_INCLUDE_DIRS})
    link_directories(${OpenCV_LIBRARY_DIRS}) 
else (OpenCV_FOUND)
    message(FATAL_ERROR "Could not find OpenCV library")
endif (OpenCV_FOUND)

if(Boost_FOUND)
    include_directories(${Boost_INCLUDE_DIRS})    
	 message(STATUS "Boost libraries: "${Boost_LIBRARIES})
endif(Boost_FOUND)

# Include internal directories
include_directories(${PROJECT_SOURCE_DIR}/rl ${PROJECT_SOURCE_DIR}/sg ${PROJECT_SOURCE_DIR}/utility)

# sub projects
add_subdirectory(rl)
add_subdirectory(sg)
add_subdirectory(utility)
add_subdirectory(topcd)
add_subdirectory(sample)
add_subdirectory(outlier)
add_subdirectory(filter)
add_subdirectory(transform)
add_subdirectory(feature)
add_subdirectory(classify)
add_subdirectory(parameter)
add_subdirectory(parsing)
add_subdirectory(model)

# tests
add_subdirectory(tests)